<template>
  <div class="guide">
    <div class="menu-bar">
      <div @click="link(item.path)" v-for="(item, index) in list" :key="index">
        <!-- 子导航 -->
        <span class="components-type"> {{ item.name }}</span>
        <div
          @click="link(menu.path)"
          class="menu-nar"
          v-for="(menu, z) in item.list"
          :key="z"
        >
          <!-- 子导航 -->
          <span class="louis-font-capitalize">{{ menu.title }}</span>
          <span>{{ menu.name }}</span>
        </div>
      </div>
    </div>
    <div class="router-view">
      <router-view />
    </div>
  </div>
</template>
<script>
export default {
  props: {},
  data() {
    return {
      list: [
        {
          name: "basics",
          list: [
            {
              title: "button",
              name: "按钮",
              path: "/components/button",
            },
            {
              title: "color",
              name: "色彩",
              path: "/components/color",
            },
          ],
        },
      ],
    };
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {},
  methods: {
    link(path) {
      this.$router.push(path);
    },
  },
  components: {},
};
</script>
<style scoped lang='scss'>
.guide {
  width: 100%;
  // background-color: aqua;
  display: flex;
  height: calc(100% - 70px);
  .menu-bar {
    width: 200px;
    display: inline-block;
    height: calc(100vh - 70px);
    overflow: hidden;
    overflow-y: auto;
    // border-right: 1px solid #cccccc;
    .components-type {
      font-size: 12px;
      padding: 5px;
      line-height: 40px;
      color: #666c72;
    }
    .menu-nar {
      text-align: left;
      margin: 20px 5px;
      margin-top: 0px;
      cursor: pointer;
    }
    .menu-nar:nth-child(1) {
      margin-top: 10px;
    }
    .menu-nar:hover {
      color: #409eff;
    }
  }
}
</style>